/**
 * 报表设计公司(2011)
 */
package com.reportgear.designer.action.edit;

import java.util.EventObject;

import com.reportgear.core.util.ImageUtils;
import com.reportgear.designer.action.UndoableAction;
import com.reportgear.report.view.JWorksheet;

/**
 * 单元格取消合并
 * 
 * @version 1.0 2011-3-24
 * @author <a herf="lexloo@gmail.com">lexloo</a>
 * @since ANNCSR 2.0
 */
public class UnmergeCellAction extends UndoableAction {

	public UnmergeCellAction() {
		setName("拆散");
		setMnemonic('G');
		setSmallIcon(ImageUtils.readIcon("/resources/images/edit/unmerge.png"));
	}

	@Override
	public boolean executeAction(EventObject evt) {
		JWorksheet workSheet = getWorkSheet();
		if (workSheet == null) {
			return false;
		}
		workSheet.unmergeCell();
		return true;
	}
}
